/*LICENSE_BEGIN
 * ******************************************************************
 * Copyright 2006 by the Dainamite Robocup-Team at the
 * DAI-Labor, TU-Berlin (www.dai-labor.de)
 * 
 * Members of Dainamite are:
 * Holger Endert
 * Robert Wetzker
 * Thomas Karbe
 * Axel Heßler
 * Philippe Bütter
 * Felix Brossmann
 * 
 * Licensed under the GNU GPL (General Public License) Free Software 
 * License, Version 2. You may use this file only in compliance with 
 * the License. You may obtain a copy of the License at:
 * 
 * http://www.fsf.org/licensing/licenses/gpl.txt
 * ******************************************************************
LICENSE_END*/
package robocup.component.actions;

/**
 * A TackleAction action is used to execute a tackle command. The effect of that
 * action is uncertain, and the costs are high. If the ball is more distant,
 * the chance of successful tacklings reduces fast. After tackling (in both 
 * cases, successful or not) the agent can't move for an amount of cycles as 
 * defined in SConf.TACKLE_CYCLES.<br>
 * 
 * Note that tackling can only be performed into two directions - the body 
 * direction or the opposite one.
 */
public class TackleAction extends Action {

	/**
	 * The power of the tackle command. This has the same meaning as the power
	 * of the KickAction. The only difference is, that it can be set to values
	 * of [-100,100] to enable backward tacklings (because of the missing
	 * direction parameter).
	 */
	private int _power;

	/**
	 * Constructor - creates a tackle-action
	 * 
	 * @param power
	 *            the tackle power: [-100,100]
	 */
	public TackleAction(int power) {
		this._power = power;
		this._type = TYPE.TACKLE;
	}

	/**
	 * @return Returns the power. 
	 */
	public int getPower() {
		return this._power;
	}

	/**
	 * Returns the actions string representation:
	 * @return 
	 * (tackle &lt;power&gt;)<br><br>
	 */
	@Override
	public String toString() {
		StringBuffer buf = new StringBuffer();
		buf.append("(tackle ");
		buf.append(this._power);
		buf.append(")");
		return buf.toString();
	}

}
